package com.westos.echufang.config.handler;

import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class AlterPasswordIntercepter implements HandlerInterceptor {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        Object loginUser = request.getSession().getAttribute("phoneTest");

        if (loginUser==null){
            request.setAttribute("phoneTest","请验证手机号");
            request.getRequestDispatcher("/findPwd").forward(request,response);
            return false;
        }else
            return true;

    }
}
